package com.user.dto;

import java.util.ArrayList;
import java.util.Collection;

public class UserDetailDto {
    private String username;
    private String password;
    private Collection<GramtedAuthorityImpl> authorities;

    public UserDetailDto() {
//    this.username = "admin";
//    this.password = "$2a$10$NOEHdEJIXfGXg3Hkjg88EOzR/0joUopUlkIpDPkmiah1bx4TMRwf.";
        GramtedAuthorityImpl gramtedAuthority = new GramtedAuthorityImpl("ROLE_admin");
        ArrayList arrayList = new ArrayList<GramtedAuthorityImpl>();
        arrayList.add(gramtedAuthority);
        authorities = arrayList;
    }

    public UserDetailDto(String username, String password) {
        this.username = username;
        this.password = password;
        GramtedAuthorityImpl gramtedAuthority = new GramtedAuthorityImpl("ROLE_admin");
        ArrayList arrayList = new ArrayList<GramtedAuthorityImpl>();
        arrayList.add(gramtedAuthority);
        authorities = arrayList;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Collection<GramtedAuthorityImpl> getAuthorities() {
        return authorities;
    }

    public void setAuthorities(Collection<GramtedAuthorityImpl> authorities) {
        this.authorities = authorities;
    }

    public String getPassword() {
        return password;
    }

    public String getUsername() {
        return username;
    }
}
